﻿using System.Web.Mvc;
using EPiServer.Shell.Gadgets;
using EPiServer.Shell;
using System;

namespace TicTacGadget.Controllers
{
    [Gadget]
    public class TicTacToeController : Controller
    {
        public ActionResult Index()
        {
            ViewData["serviceUrl"] = string.Format("{0}://{1}:{2}{3}",
                Request.Url.Scheme, 
                Request.Url.Host, 
                Request.Url.Port,
                Paths.ToResource("TicTacGadget", "Services/GameService.svc"));
            ViewData["player"] = User.Identity.Name ?? Guid.NewGuid().ToString().Substring(0, 8);

            return View();
        }
    }
}
